<template>
	<div>
		<MkQueryContainer>
			<template #header="">
				<MkForm ref="queryForm" :model="searchParam" :inline="true" :col="4">
					<MkInput label="关键字" @keyup.enter.native="search" v-model="searchParam.keyword" clearable="" />
					<MkDatePicker label="开单时间" v-model="searchParam.startTime" />
					<MkDatePicker label="至" v-model="searchParam.endTime" />
					<MkSelect label="打印状态" :options="['未打印', '已打印']" v-model="daYinZhuangTai" />
					<el-form-item>
						<MkButtonQuery @click="search"> </MkButtonQuery>
					</el-form-item>
				</MkForm>
			</template>
			<MkTable :data="tableData" v-loading="loading" @row-dblclick="edit" fit>
				<MkColumnIndex />
				<MkColumn prop="id" label="申请单号" />
				<MkColumn label="打印状态" />
				<MkColumn label="备血状态" />
				<MkColumn label="患者Id" />
				<MkColumn label="姓名" />
				<MkColumn label="科室" />
				<MkColumn label="床号" />
				<MkColumn label="备血明细信息" />
				<MkColumn label="已取血信息" />
			</MkTable>
			<MkPagination v-model:page="searchParam.page" v-model:pageSize="searchParam.pageSize" :total="total"
				@query="search" />
		</MkQueryContainer>
		<Edit ref="editRef" />
	</div>
</template>
<script lang="ts" setup name="QuXuePingZheng">
import Edit from './edit.vue'
import { TraPeiXueApi, TraPeiXueOutput } from '/@/api/tra/TraPeiXue';
import { usePageQuery } from '/@/hooks';

const daYinZhuangTai = ref('未打印')
const { searchParam, total, tableData, loading, search } = usePageQuery<TraPeiXueOutput>(TraPeiXueApi.page);
const editRef = ref();

const edit = (row) => {
	console.log(row);
	editRef.value?.loadingEntity(row);
}
</script>
<style lang="scss" scoped></style>
